import request from '@/utils/request';

export default {
    //加载流程树
    loadtree(parId) {
        return request.get('/esbview/v-workflow-tree/listNode/' + parId)
    },

    //加载流程树
    loadtreeForEdit(parId) {
        return request.post('/esbview/v-workflow-tree/listNode/' + parId, "1")
    },

    //新增流程环节
    saveWf(data) {
        return request.post('/esbview/v-workflow-tree/save', data)
    },

    //流程拖拽之后，保存新的列表
    saveWfList(data) {
        return request.post('/esbview/v-workflow-tree/saveWfList', data)
    },

    //删除流程树节点
    delWftree(id) {
        return request.post('/esbview/v-workflow-tree/delete', id)
    },

    //加载流程的环节
    loadAction(scaId) {
        return request.get('/esbview/v-workflow/list/' + scaId)
    },

    //加载流程的环节(不带总视图环节)
    loadActionWithoutTotal(scaId) {
        return request.post('/esbview/v-workflow/list/' + scaId, '1')
    },

    //环节拖拽之后，保存新的列表
    saveActionList(data) {
        return request.post('/esbview/v-workflow/saveActionList', data)
    },

    //新增一个环节
    saveAction(data) {
        return request.post('/esbview/v-workflow/save', data)
    },

    //删除流程节点
    delWf(id) {
        return request.post('/esbview/v-workflow/delete', id)
    }
}
